package settings;

import logic.nodes.nodeSettings.Settings;

public class Config extends ConfigFile {
	
	private static final String USE_CLONE_LOADING = "UseCloneLoading";
	private static final String ENABLE_AI = "EnableAI";
	private static final String VISIBILITY_CALC = "VisibilityCalculations";
	private static final String ENABLE_THREADING = "EnableThreading";
	private static final String SHOW_HUD = "ShowHUD";
	private static final String DISABLE_SIMPLE_EXPLOSIONS = "disable_simple_explosions";
	private static final String SPAWN_MENU_DEATH_DELAY = "spawnmenu_death_delay";
	private static final String USE_LOD = "use_lod";
	private static final String SHOW_TIPS = "show_tips";
	private static final String ENABLE_SOUND = "enable_sound";
	
	private static Config settings = new Config();
	
	private Config() {
		super();
	}
	
	public static Config get() { return settings; }
	
	@Override
	public void reset() { settings = new Config(); }
	
	@Override
	public String getFileName() { return "config.xml"; }
	
	@Override
	protected Settings getSettings() { return settings; }
	
	public boolean getCloneLoading() { return Boolean.valueOf(getValueOf(USE_CLONE_LOADING)).booleanValue(); }
	
	public boolean getEnableAI() { return Boolean.valueOf(getValueOf(ENABLE_AI)).booleanValue(); }
	
	public int getVisCalc() { return Integer.valueOf(getValueOf(VISIBILITY_CALC)).intValue(); }
	
	public boolean getEnableThreading() { return Boolean.valueOf(getValueOf(ENABLE_THREADING)).booleanValue(); }
	
	public boolean getShowHUD() { return Boolean.valueOf(getValueOf(SHOW_HUD)).booleanValue(); }
	
	public boolean getDisableSimpleExplosions() {
		return Boolean.valueOf(getValueOf(DISABLE_SIMPLE_EXPLOSIONS)).booleanValue();
	}
	
	public int getSpawnMenuDeathDelay() { return Integer.valueOf(getValueOf(SPAWN_MENU_DEATH_DELAY)).intValue(); }
	
	public boolean useLOD() { return Boolean.valueOf(getValueOf(USE_LOD)).booleanValue(); }
	
	public boolean showTips() { return Boolean.valueOf(getValueOf(SHOW_TIPS)).booleanValue(); }
	
	public void disableTips() { addOption(SHOW_TIPS, "false"); }
	
	public boolean soundEnabled() { return Boolean.valueOf(getValueOf(ENABLE_SOUND)).booleanValue(); }
}